Replacing ZZZ for suspend to RAM

if you're not snoozing, you're losing

Home About Projects Blog Games Contact Support

ZZZ is great, I have no complaints, but when researching why solaar wasn't working I also wanted to fix my desktop waking up immediately when suspending to ram when running doas zzz. If I want to boot right up or log right in without waiting a minute or 2 (less usually, alpine boots very fast), I tend to suspend to ram instead of hibernating or shutting off the machine. Although that would probably save some power and lower the electric bill slightly.

The issue was solaar not having the udev rules to recognize and handle the logitech receiver, and suspend worked fine after that, but ZZZ is a simple script, and ultimately on my setup it can be replaced by echoing 'mem' to /sys/power/state. So for the purpose of having a simpler system with less packages, leading to less issues over time, and using more homemade code, I did just that to replace it.

Make a new script and mark it executable and you're good to go:

printf "#!/bin/sh\necho mem > /sys/power/state\n" > suspend_to_mem.sh
chmod +x ./suspend_to_mem.sh
doas ./suspend_to_mem.sh